//
//  HJSimplePopWindowCell.swift
//  APPTestSwift
//
//  Created by hiking on 2020/2/16.
//  Copyright © 2020 hiking. All rights reserved.
//

import UIKit

class HJSimplePopWindowCell: UITableViewCell {
    
    lazy var separatorLine:UIView = {
        let view = UIView(frame: CGRect.zero)
        view.backgroundColor = UIColor.gray
        return view
    }()
    
    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        selectionStyle = .none
        addSubview(self.separatorLine)
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
        separatorLine.frame = CGRect.init(x: 0, y: frame.height-0.5, width: frame.width, height: 0.5)
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    override func awakeFromNib() {
        super.awakeFromNib()
        addSubview(self.separatorLine)
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)
        
        textLabel?.textColor = selected ? .red : .black
        
    }

}
